package com.hon.legionnaire.negocio.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "cliente")
@SequenceGenerator(name = "cliente_seq", sequenceName = "cliente_cod_cliente_seq", allocationSize = 1)
@NamedQueries ({
	@NamedQuery(name = "loadAllCliente", query = "from ClienteVO"),
	@NamedQuery(name = "findCliente", query = "from ClienteVO as c where c.codigo = :codigo"),
	@NamedQuery(name = "findDuplicatedCliente", query = "from ClienteVO as c where c.cpf = :cpf and c.codigo != :codigo")
})
public class ClienteVO extends PessoaVO implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "cod_cliente")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "cliente_seq")
	private int codigo;
	
	@Column(name = "rg", length = 12)
	private String rg;
	
	@Column(name = "cpf", length = 15, unique = true)
	private String cpf;
	
	@Column(name = "status")
	private int status;

	public int getCodigo() {
		return codigo;
	}

	public void setCodigo(int codigo) {
		this.codigo = codigo;
	}

	public String getRg() {
		return rg;
	}

	public void setRg(String rg) {
		this.rg = rg;
	}

	public String getCpf() {
		return cpf;
	}

	public void setCpf(String cpf) {
		this.cpf = cpf;
	}

	public ClienteVO(int codigo, String nome, String telefone1,
			String telefone2, String celular, String email, String comentario,
			Date dataCriacao, Date dataAlteracao, int codigo2, String rg,
			String cpf) {
		super(codigo, nome, telefone1, telefone2, celular, email, comentario,
				dataCriacao, dataAlteracao);
		codigo = codigo2;
		this.rg = rg;
		this.cpf = cpf;
	}

	public ClienteVO() {
		super();
		// TODO Auto-generated constructor stub
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
	
	
	
			
}